package com.example.multiactivity;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class SecondActivity extends AppCompatActivity {

    private Button btn_Sendback;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        btn_Sendback = (Button) findViewById(R.id.btn_sendback);
        btn_Sendback.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = getIntent();
                String number = intent.getStringExtra("No");
                String school = intent.getStringExtra("School");
                Intent intent2 = new Intent();
                intent2.putExtra("BackInfo", number + ":" + school);
                setResult(Activity.RESULT_OK,intent2);
                finish();
                //Toast.makeText(SecondActivity.this, number+school, Toast.LENGTH_SHORT).show();
            }
        });
    }
}